{{response.files.append(URL(r=request,c='static',f='jquery.dataTables.min.js'))}}
{{response.files.append(URL(r=request,c='static',f='demo_table.css'))}}
{{extend 'layout.html'}}

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    jQuery('.smarttable').dataTable();
} );
</script>

<h1>Persons by Organization</h1>

<button onclick="document.location='{{=URL(r=request,f='create_person',args=organization.id)}}'">Create a New person</button>

<table class="smarttable">
<thead>
    <th>Name</th>
    <th>Role</th>
    <th>Actions</th>
</thead>
<tbody>
{{for person in persons:}}
<tr>
    <td>{{=person.name}}</td>    
    <td>{{=person.role}}</td>
    <td>
    <a href="{{=URL(r=request,f='edit_person',args=person.id)}}">Edit</a>
    </td>
</tr>
{{pass}}
</tbody>
</table>
